import React, {useEffect} from 'react'
import {Button} from 'antd'
import { getData, postData } from '../api/test'
const Test = () => {

    useEffect(()=>{
        getData()
            .then(res=>{
                console.log(res)
            })
            .catch(()=>{})
    },[])
    const post = () => {
        postData('zhangsan', 1000)
            .then(res=>{
                console.log(res);
            })
    }
    return (
        <div>
            <Button onClick={post}>提交</Button>
        </div>
    )
}

export default Test